package com.paic.mhis.hcpms.assessment.intergration.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.paic.mhis.hcpms.assessment.dto.IndicatorConfigDetailDTO;
import com.paic.mhis.hcpms.assessment.dto.IndicatorConfigInfoDTO;
import com.paic.mhis.hcpms.assessment.dto.IndicatorConfigParamsDTO;
import com.paic.mhis.hcpms.assessment.dto.IndicatorHomeInfoDTO;
import com.paic.mhis.hcpms.assessment.intergration.dao.AssessmentIndicatorDAO;
import com.paic.pafa.biz.dao.BaseDAO;

/**
 * 评价指标配置
 * @author EX-CAOTIANHUA001
 *
 */
@Component("assessmentIndicatorDAO")
public class AssessmentIndicatorDAOImpl extends BaseDAO implements AssessmentIndicatorDAO {

	@SuppressWarnings("unchecked")
	@Override
	public List<IndicatorHomeInfoDTO> queryIndicatorHomePage(String regionCode,String indicatorCode) {
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("regionCode", regionCode);
		param.put("indicatorCode", indicatorCode);
		return  (List<IndicatorHomeInfoDTO>) _list("assessmentDao.queryHomeIndicatorInfo", param);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<IndicatorConfigInfoDTO> queryEachIndicatorInfo(String indicatorCode,String orgLevel,String regionCode) {
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("indicatorCode", indicatorCode);
		param.put("orgLevel", orgLevel);
		param.put("regionCode", regionCode);
		return (List<IndicatorConfigInfoDTO>) _list("assessmentDao.queryEachIndicatorInfo", param);
	}

	@Override
	public void insertStandardParams(IndicatorConfigParamsDTO dto) {
		_insert("assessmentDao.insertStandardParams", dto);
	}

	@Override
	public void updateStandardParams(IndicatorConfigParamsDTO dto) {
		_update("assessmentDao.updateStandardParams", dto);
	}

	@Override
	public void insertConfigDetail(IndicatorConfigDetailDTO dto) {
		_insert("assessmentDao.insertConfigDetail", dto);
	}

	@Override
	public void deleteConfigDetail(String indicatorCode,String orgLevel,String regionCode) {
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("indicatorCode", indicatorCode);
		param.put("orgLevel", orgLevel);
		param.put("regionCode", regionCode);
		_update("assessmentDao.deleteConfigDetail", param);
	}

	@Override
	public void updateConfigDetail(IndicatorConfigDetailDTO dto) {
		_update("assessmentDao.updateConfigDetail", dto);
	}

	@Override
	public String queryCurrentVersion() {
		return _getString("assessmentDao.queryCurrentVersion", null);
	}

}
